module.exports = class extends think.Logic {
  addAction() {
    this.allowMethods = 'post';
    this.rules = {
      addr: {
        string: true,
        required: true,
        method: 'POST'
      },
      name: {
        string: true,
        required: true,
        method: 'POST'
      },
      peopleNum: {
        int: {min: 1, max: 200},
        required: true,
        method: 'POST'
      }
    };
  }
  editAction() {
    this.allowMethods = 'put';
    this.rules = {
      addr: {
        string: true,
        required: true,
        method: 'PUT'
      },
      name: {
        string: true,
        required: true,
        method: 'PUT'
      },
      peopleNum: {
        int: {min: 1, max: 200},
        required: true,
        method: 'PUT'
      },
      id: {
        int: true,
        required: true,
        method: 'GET'
      }
    };
  }
  delAction() {
    this.allowMethods = 'delete';
    this.rules = {
      id: {
        int: true,
        required: true,
        method: 'GET'
      }
    };
  }
  listAction() {
    this.allowMethods = 'get';
  }
};
